cmake_minimum_required(VERSION 3.20)

project(CppClient)

set(CMAKE_CXX_FLAGS "-std=c++17 ${CMAKE_CXX_FLAGS}")             # c++17
set(CMAKE_CXX_FLAGS "-g ${CMAKE_CXX_FLAGS}")                     # 调试信息
set(CMAKE_CXX_FLAGS "-Wall ${CMAKE_CXX_FLAGS}")                  # 开启所有警告

set(SOURCE_DIR src)
set(UTIL_DIR util)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/output_bin)

set(UTIL_SOURCES ${UTIL_DIR}/error.cpp)

add_executable(server ${SOURCE_DIR}/server.cpp ${UTIL_SOURCES})
add_executable(client ${SOURCE_DIR}/client.cpp ${UTIL_SOURCES})